#include <iostream>
#include <list>
#include <gtest/gtest.h>

class SuitTest : public testing::Test
{
public:
    static void SetUpTestCase()
    {
        std::cout << "SetUpTestCase: 环境初始化..." << std::endl;
    }

    virtual void SetUp() override
    {
        std::cout << "SetUp: 单元测试初始化..." << std::endl;
        _list.push_back(22);
        _list.push_back(220); //每个单元测试独立测试数据
    }

    virtual void TearDown() override
    {
        std::cout << "TearDown: 单元测试清理..." << std::endl;
        _list.clear();
    }

    static void TearDownTestCase()
    {
        std::cout << "TearDownTestCase: 环境清理..." << std::endl;
    }
public:
    std::list<int> _list;
};

TEST_F(SuitTest, pushBack)
{
    _list.push_back(1);
    _list.push_back(10);
}

TEST_F(SuitTest, size)
{
    ASSERT_EQ(_list.size(), 2);
}

int main(int argc, char* argv[])
{
    testing::InitGoogleTest(&argc, argv);
    RUN_ALL_TESTS();

    return 0;
}